Creation of dynamic xpath for native ios app using appium

Hi
I’m facing an issue regarding the xpath which is dynamic. Can anyone help me creating dynamic xpath.

xpath: //UIAApplication[1]/UIAWindow[1]/UIATableView[2]/UIATableCell[4]

where UIATableView[2] goes on changing from 2 to 1 or 1 to 2

Please find the inspector screenshot below

Please help me

Thanks in advance

Couldn’t you just use:
//UIAApplication[1]/UIAWindow[1]/UIATableView/UIATableCell[4]

or

//UIAApplication[1]/UIAWindow[1]/UIATableView/UIATableCell And search for the element that contains the text of the cell you want to interact with?

or

You could use the ‘name’ field as the ID of the cell.

Switch to Native View - ((IOSDriver) driver).context(“NATIVE_APP”);

Below Xpath Should work

//UIAButton[@name=‘Invoices’]