cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shuhn1229
Helper I
Helper I

Collecting for a Lookup Column

Hi,

 

I am creating a collection that power automate will write to sharepoint.  All of my columns in the collection are very simple and write correctly, similar to the below.

CountryName: Country.Text

 I am running into issues collecting the lookup column, which does not write to the sharepoint following the flow.  I think this is because lookups have a record component (i.e. an ID and a Value). I've tried the statement below without any luck

        {LookupColumn:{
                        Id:Gallery1.Selected.ID,
                        Value:Gallery1.Selected.Title}
             }

 Any suggestions?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
shuhn1229
Helper I
Helper I

 LookUp: {
                
                Id: Combobox.Selected.ID
                
            }

 

 

 

View solution in original post

4 REPLIES 4
Gochix
Solution Sage
Solution Sage

Hi @shuhn1229 ,

 

Could we get a full code of your flow in PowerApps - or example of it.

With 3 lines of code it's not quite clear what is going on here.

 

Also if you could share a screenshot or give us all errors that you get from power automate run history then it would help to understand the issue.

shuhn1229
Helper I
Helper I

Hi Gochix,

 

Thanks for the help. I know this issue is resulting to writing to a lookup column as deleting that collection/create item rescues the flow. A few details, I am using Reza's multi upload app.

 

First, the items are sent to a collection and then sent to flow where the flow creates items based on the collection. Here is an example collection of two items in the powerapp. The country field works fine, the lookup does not.

 

CountryName: Country.Text,
Lookup: {
                '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id: ComboBox.Selected.ID,
                Value: ComboBox.Selected.Title

 

In powerautomate have a create items flow with the following expression that I use for each item, with the brackets referencing the collection in the app:

 

items('Apply_to_each_and_send_to_SharePoint_List')?['Title']

 

The flow fails when I use this expression with the lookup column, and I get the following error: 

{
  "status"400,
  "message""Item could not be created. Check if input is valid.\r\nclientRequestId: e56d32f1-8158-4740-9819-299d4adf8518\r\nserviceRequestId: e56d32f1-8158-4740-9819-299d4adf8518"
}
 
Deleting the collection for the lookup allows the whole thing to work.
 
Please do let me know if you need further details.

Hi - 

 

I've seemed to make some progress - the data entry part of the flow field is only asking for the ID of the Lookup from the collection. If I manually set it to a number it works! IS there anyway to transfer only the number from the collection? If I just do:

 

Lookup: Value: ComboBox.Selected.Title

  

My button errors out because it says the column is expecting a record.

shuhn1229
Helper I
Helper I

 LookUp: {
                
                Id: Combobox.Selected.ID
                
            }

 

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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