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

Multichoice LU Field disappearing on New Form and form throwing a Bad Gateway error on updating form

I am using a SharePoint list as my datasource (Onboarding) for my canvas powerapp.  I have researched the field disappearing since Tuesday and cannot seem to get it to work properly.  Once I set up the Update property on the Director field, it worked to save it to the form but would throw a Bad Gateway error.  It is not saving to the form anymore, though, either.  The director field is filtered by the value in the division field.  PLEASE HELP!  I have been messing with this for days and did not have a bad gateway error until Tuesday after months of testing.  It was after I added the function to the Update and DefaultSelectedItems that it started throwing the error when editing an existing item but when I create a new item, it sends the data to SharePoint except for the Director values (Result) and loses the data in the LUDirectorDataCardValue11 dropdown box.  IT IS NOT A COMBO BOX.  Any help will be very, very appreciated.

 

Division (Choice column)

LUDirector (LU Column with the mulitple choices checked to another SharePoint list called DivisionDirector )
LUDirectorDataCardValue.Item:  

 

Distinct(Filter(Choices([@Onboarding].LUDirector),Value in Filter(DivisionDirector, LUDivisionsDivDir.Value = DivisionDataCardValue11.Selected.Value).txtDirector),Value).Result

 

LUDirectorCard.Update:

 

ForAll(
DirDataCardValue11.SelectedItems,
{
Id: ID,
Value:  LUDirector
}
)

 

LUDirectordDataCardValue11.DefaultSelectedItems:

 

ForAll(
ThisItem.LUDirector,
{
LUDirector:  Value,
ID: Id
}
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
GoGorilla
Helper III
Helper III

@v-qiaqi-msft After working with Microsoft, we found a solution:

The app was not inserting the object(ID and Value) of the items in the lookup into the column, but we were trying to do strings/arrays. After we updated the code to create a collection of objects we were able to get this working.
The code we updated was broken into two parts:
 
To make this app able to do multiple selects, we create a collection instead
OnChange of dropdown control:
Clear(CollectionName);
ClearCollect(CollectionName, DataCardValue.SelectedItems)

Update of dropdown control (CARD: LUDirector).  Note that the datasource in this is NOT the main datasource (Onboarding), but the data source to which the lookup column refers (DivisionDirector) and the field name in that data source (txtDirector) as opposed to LUDirector:
ForAll(colname, (Id: Lookup(datasource,Fieldname=Result).ID,
Value: Lookup(datasource,Fieldname=Result).Fieldname)


These changes replace those values with the actual objects that would be added and adds them to the SharePoint list.

View solution in original post

4 REPLIES 4
v-qiaqi-msft
Community Support
Community Support

Hi@GoGorilla,

Could you please share a bit more about the scenario? A screenshot would be appreciated.

1). Is the LUDirector a Lookup column type?

2). Is the LUDirector filtered by the value in the Division field? (Please ensure the consistency of the column name)? 

Besides, if the error code 500 or 502 appears, the failure is temporary or transient. Click or tap Resubmit to try the flow again.

Please provide more details and we would provide proper workaround for you.

Regards,

Qi

 

 

 

Best Regards,
Qi
GoGorilla
Helper III
Helper III

@v-qiaqi-msft I am getting the error " Your post has been changed because of invalid HTML was found in the message body".  I checked the HTML and nothing is wrong.  I will send in stages.

@v-qiaqi-msft 

1). Is the LU Director a Lookup column type?

LU Director is a lookup column that allows multiple values (SEE ATTACHED)

 

2). Is the LU Director filtered by the value in the Division field? (Please ensure the consistency of the column name)?

LU Director is filtered by formula that starts with the Distinct function in my post in the Items property where DivisionDataCardValue11 is the Division choice field.

 

The error is not transient or temporary as it has been happening for 5 days.  Please see Form and Gallery attachment where it is now saving to the form correctly but not submitting to the SharePoint list Onboarding (data source).   EDIT:  It is not saving once I open another item in the gallery.  When I go back into the item I previously submitted, I am seeing what is in the imgFormBlank attachment.

 

Also, this is a PowerApps form not a PowerAutomate flow.  I noticed that you said to resubmit to try the flow again.  Maybe you were referring to the submitting of the form?

GoGorilla
Helper III
Helper III

@v-qiaqi-msft Have you had a chance to take a look at this?  I am sure you are very busy so I apologize for being so pushy.  I am very frustrated because nothing I am coming across is a solution.  Also to note, I do not have more than 12 complex columns in my SharePoint list.

GoGorilla
Helper III
Helper III

@v-qiaqi-msft After working with Microsoft, we found a solution:

The app was not inserting the object(ID and Value) of the items in the lookup into the column, but we were trying to do strings/arrays. After we updated the code to create a collection of objects we were able to get this working.
The code we updated was broken into two parts:
 
To make this app able to do multiple selects, we create a collection instead
OnChange of dropdown control:
Clear(CollectionName);
ClearCollect(CollectionName, DataCardValue.SelectedItems)

Update of dropdown control (CARD: LUDirector).  Note that the datasource in this is NOT the main datasource (Onboarding), but the data source to which the lookup column refers (DivisionDirector) and the field name in that data source (txtDirector) as opposed to LUDirector:
ForAll(colname, (Id: Lookup(datasource,Fieldname=Result).ID,
Value: Lookup(datasource,Fieldname=Result).Fieldname)


These changes replace those values with the actual objects that would be added and adds them to the SharePoint list.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,298)