So I have one gallery connected to three SharePoint lists. The items show in gallery is determined by what list is selected (the selected list is set using a drop-down). The issue is these three SharePoint lists need to show different columns for title, subtitle and body. For my Electrical Industry ECL I want it to show the Name column as title, the Title column as Subtitle and the Organisation column as the body. Whereas for the Transpower Contacts ECL I want to show the Name column as title, the Title column as Subtitle and the Phone column as the body. For the Satellite ECL I want to show Allocated To column as title, Organisation column as subtitle and Location column as body. The issue is when using ThisItem to set the text of title/subtitle/body the only options I have is to use a column name present in all three data sources. Essentially what I want to do is to set the title/subtitle/body text to a column based on what list is selected. I tried renaming the columns however, this didn't help.
Here are photos of the list:
The issue I am coming across:
The way I am filtering Items based on Contact List selected:
Also I am not sure if it makes a difference but visibility is based on whether the person is actually on the contact list:
Solved! Go to Solution.
@Xpholio ,
I did not test that (and have never done it), but am a bit surprised it did not give you the fields.
To be honest, the simplest way would be three galleries and set the Visible to the one you have selected or you could use RenameColumns in the Items to get all the fields with the same names.
Switch(
YourDropDownName.Selected.Value,
"Transpower",
RenameColumns(
Emergency_Contact_List_Transpower_Contacts,
"Satellite",
"Contact"
),
"Electrical"
RenameColumns(
Electrical_Industry_ECL,
"Mobile",
"Contact"
),
"Radio"
RenameColumns(
Mobile_Radio_and_Satellite_ECL"
"Radio_x0020_ID",
"Contact"
)
)
so in the above, ThisItem.Contact would be available.
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 @Xpholio ,
Firstly, the Title, Subtitle and Body Text fields provided are only placeholders - you do not need them (in a blank gallery, you get no fields).
You can delete them all and insert labels of your choice, call them whatever you want and in the Text property put
ThisItem.YourFieldName
(whatever the field).
I also noticed a Delegation warning in the Items of your gallery on User().Email. This is because it is not a Delegable filter, however if you put this at App OnStart
Set(varUserMail,User().Email)
and base your Filter on varUserMail, the Delegation issue will disappear.
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.
Oh ok thanks. But doing that doesn't really solve my key issue which is that the field names that are available are only field names common to all three data sources but I need to be able to set the label text to field names that are only in one data source.
@Xpholio ,
You can have conditional Items on a gallery like this
Switch(
YourDropDownName.Selected.Value,
"Transpower",
Emergency_Contact_List_Transpower_Contacts,
"Electrical",
Electrical_Industry_ECL,
"Radio",
Mobile_Radio_and_Satellite_ECL"
)
If you have common field names , then
ThisItem.YourFieldName
will work on all three, however if some are not, use the same logic (example only) - the Text of
Switch(
YourDropDownName.Selected.Value,
"Transpower",
ThisItem.Satelite,
"Electrical",
ThisItem.Mobile,
"Radio",
ThisItem.'Radio ID'
)
will show the value relevant to what is selected.
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.
Unfortunately when I try this it doesn't show the value relevant to what is selected. It still only shows fields common to all three data sources.
Here is a photo to prove this:
If it was showing unique fields then for example 'Phone' should be an option between Modified and title
@Xpholio ,
I did not test that (and have never done it), but am a bit surprised it did not give you the fields.
To be honest, the simplest way would be three galleries and set the Visible to the one you have selected or you could use RenameColumns in the Items to get all the fields with the same names.
Switch(
YourDropDownName.Selected.Value,
"Transpower",
RenameColumns(
Emergency_Contact_List_Transpower_Contacts,
"Satellite",
"Contact"
),
"Electrical"
RenameColumns(
Electrical_Industry_ECL,
"Mobile",
"Contact"
),
"Radio"
RenameColumns(
Mobile_Radio_and_Satellite_ECL"
"Radio_x0020_ID",
"Contact"
)
)
so in the above, ThisItem.Contact would be available.
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.
Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.
Did you miss the call?? Check out the Power Apps Community Call here!
User | Count |
---|---|
265 | |
209 | |
77 | |
41 | |
33 |
User | Count |
---|---|
344 | |
217 | |
117 | |
71 | |
54 |