cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Unbihexium
Helper III
Helper III

match between a Gallery and a Table

Hello guys

I'm trying to get a match between a Gallery and a Table with the LookUp function.
I get an error message "Invalid formula. A value compatible with "DataSource" was expected. "
It seems this is not possible... but I think there is maybe another way to achieve this? Or am I doing something wrong?

What I try to achieve:
In PowerApps I can select an "Order" from a Gallery which is connected with a SP List.

on the new page--> (Please see screenshot for more understanding) I can edit the form

Unbihexium_0-1625478797213.png

 


FormA (Flugbuchungen_Formular) --> Editable text fields and selectable values and an unique ID number --> SP List
FormB (Form4) --> not editable/visible fields which copies the values/texts from FormA (actually 1:1 the same informations) --> Excel file

When I hit the "save" button --> it submits the Forms --> Form1 to a SP List // --> Form2 to a Excel list (OneDrive)
((the save button does the following;
SubmitForm(Flugbuchungen_Formular);; SubmitForm(Form4);; Navigate(Hauptseite;ScreenTransition.Fade)))
which works... for new entries

if I want to edit an existing Table entry I need to declair (at the item field) which object or row have to be modified... and there is my problem:
with this I get the following error: "Invalid formula. A value compatible with "DataSource" was expected. "

If(Form4.Mode = FormMode.Edit;
LookUp(
Tabelle5.'Antrag ID'; Gallery2.Selected.'Antrag ID' = Tabelle5.'Antrag ID'
).'Antrag ID'
)

or error message "Some types are incompatible for comparison. These types cannot be compared"

If(Form4.Mode = FormMode.Edit;
LookUp(
Tabelle5.'Antrag ID'; Gallery2.Selected.'Antrag ID' = Tabelle5.'Antrag ID'
)
)

Is there another way?

Thank you in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Unbihexium ,

Where do you have this formula - it will produce a single (numeric) value, so it needs to be a Label Text or a control Default.

If that is a Form Item, you need to drop the .ID off the end of the first structure I sent (and produce a Record).

 

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

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Unbihexium ,

The correct syntax is 

If(
   Form4.Mode = FormMode.Edit;
   LookUp(
      Tabelle5;
      'Antrag ID' = Gallery2.Selected.'Antrag ID'
   ).'Antrag ID'
)

however you are going in a bit of a circle here - you just need

If(
   Form4.Mode = FormMode.Edit;
   Gallery2.Selected.'Antrag ID'
)

 

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 WarrenBelz

Thank you for your reply.

Unfortunately I get the same error with this syntax.  ("Invalid formula. A value compatible with "DataSource" was expected. ") 

Unbihexium_0-1625485815205.png

Unbihexium_1-1625488718728.png

 

 best regards

@Unbihexium ,

Where do you have this formula - it will produce a single (numeric) value, so it needs to be a Label Text or a control Default.

If that is a Form Item, you need to drop the .ID off the end of the first structure I sent (and produce a Record).

 

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 WarrenBelz

Thank you so much! It works just perfect! 

If(
   Form4.Mode = FormMode.Edit;
   LookUp(
      Tabelle5;
      'Antrag ID' = Gallery2.Selected.'Antrag ID'
   )
)

 
Have a good day!
best regards!

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (3,659)