
Hello a have a screen, which contains gallery and a form, but I don't know how return information about this item into form.
How code may look:
If(
Not(IsBlank(LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'))),//if this item exist in datasource
LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'),//return it
Otherwise return form, where will be filled only "Title" and "Error code"(will be returned from gallery)
)I don't know how to write else part, and I am not sure that "then" part is correct. Should be this code for item properties?
Thank you
Hi @Aleksandra1 ,
If you get blank result i.e. if the item doesn't exists, you can hide the form or pull latest entry from Sharepoint list. To hide the form,
1. OnVisible property of the screen use below formula -
If(IsBlank(LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code')), Set(isFormVisible, false), Set(isFormVisible, true))
2. Set visibility of the form to isFormVisible variable
3. Add a label and set visibility of it to !isFormVisible and you can add message in Text property of label stating that no item is there in SP list.
You can use below formula in Item property of the form to get latest item from SPList if selected item is not there in Datasource and no item in gallery is selected -
If(
Not(IsBlank(LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'))),//if this item exist in datasource
LookUp('Disputed cases', PrimaryKey = 'Primary Key' And ErrorCode = 'Error code'),//return it
If(!IsBlank(GalleryName.Selected), LookUp('Disputed cases', PrimaryKey = GalleryName.Selected.'Primary Key' And ErrorCode = GalleryName.Selected.'Error code'), Last('Disputed cases')))
)