Hi I am having sharepoint list customized form.
Trying to simply show files from document library in a gallery.
Items property: Filter('Supplier Documents',SupplierRefID=myid)
SupplierRefID = Text field storing the reference id of supplier.
When we hardcode the myid with some number in the dev studio, files are shown properly. I am just displaying Title & created date.
When we publish and try to run in browser, the gallery does not show anything. just blank.
Please help if any idea.
Solved! Go to Solution.
Ok @Anonymous ,
So you have a field in your List called SelectedListItemID which is Numeric and a Text version of this is stored in your Library in field called SupplierRefID?
So the Filter on your Library could be
Filter(
'Supplier Documents',
Value(SupplierRefID)=SharePointIntegration.SelectedListItemID
)
On this subject, why have you stored SupplierRefID as Text? Making it Numeric would save all this conversion.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @Anonymous ,
You can do this a number of ways - the easiest if you have selected the item from a gallery is
Filter(
'Supplier Documents',
SupplierRefID=YourGalleryName.Selected.SupplierRefID
)
If you set the Variable (Global) myID at the point your know it, then your code should certainly filter the gallery.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Yes the code should certainly filter the gallery but it is not. The Id to be compared is nothing but
SharePointIntegration.SelectedListItemID
Hence I am using this same ID by converting to Text().
The gallery is displayed on the view form, inside a custom data card. All other data is getting displayed using same ID.
My basic question is if its filtering on the dev. screen, then after publishing why its showing a blank gallery. Am I missing anything here?
OK @Anonymous ,
A bit more information so I understand your setup - please confirm if my assumptions below are correct
So assuming that the value of myid is available in the List form as a number in the field SupplierRef (change to your name) and the form has been selected from a gallery, you can set myRef on the OnSelect of the gallery.
Set(
MyRef,
YourGalleryName.Selected.SupplierRef
)
assuming this is numeric, your filter would be
Filter(
'Supplier Documents',
Value(SupplierRefID)=MyRef
)
Are my assumption correct?
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Thanks @WarrenBelz for immediate reply.
First 3 points are right. Fourth point - yes in development studio (browser), when I hard code the variable, it shows the files.
Form is not selected from gallery. The item is selected in sharepoint and we click on "Open" to view this item. So MyRef will be set as:
Set(MyRef, SharePointIntegration.SelectedListItemID);
And the "Supplier Documents" is filtered directly using this variable as:
Filter(
'Supplier Documents',
SupplierRefID=Text(MyRef)
)
When we publish this code and try to load the form, it does not show anything.
Ok @Anonymous ,
So you have a field in your List called SelectedListItemID which is Numeric and a Text version of this is stored in your Library in field called SupplierRefID?
So the Filter on your Library could be
Filter(
'Supplier Documents',
Value(SupplierRefID)=SharePointIntegration.SelectedListItemID
)
On this subject, why have you stored SupplierRefID as Text? Making it Numeric would save all this conversion.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
SelectedListItemID is not a column. Its property provided by SharePointIntegration connector to fetch us the current item selected on SP.
So, instead of converting RHS to text, converting LHS to number format worked.