cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Xpholio
Frequent Visitor

How to set text of title/subtitle/body in a gallery that is working with multiple data sources

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:
Capture.PNG

Capture.PNG

Capture.PNG

 

The issue I am coming across:
Capture.PNG

 

The way I am filtering Items based on Contact List selected:
Screenshot (2).png

 

Also I am not sure if it makes a difference but visibility is based on whether the person is actually on the contact list:
Screenshot (3).png

1 ACCEPTED SOLUTION

Accepted Solutions

@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.

 

View solution in original post

5 REPLIES 5
WarrenBelz
Super User III
Super User III

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:
Screenshot (4).png

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.

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (76,510)