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

ShowColumns with yes/no column not working?

Hello everyone, lets see if someone can give me a hand.

I have two tables in dataverse, one that contains some items. and a second one that  uses a forall() and collect for local gallery, from the first table to create daily items.  Both tables have a Yes/No column, Then what i want to do is at the end of my app i update the first "main" list with the value from the daily list/collection.

For speed purpose i do this:

 

Patch('Lodd Lager Hall', ShowColumns(colLodd, "cr17e_lodd_lager_hall_id", "cr17e_item_slutt_telt", "cr17e_item_sold_out") )

 

Before (when i used sharepoint list) it worked fine, but now it doesnt. i dont seem to get why,  when i remove the column "cr17e_item_sold_out" (which is the yes/no column) it works.  

This is the error that i get:

Skjermbilde 2021-08-17 kl. 01.23.06.png

Anyone pls ? 🙂 

 

3 REPLIES 3
BCLS776
Super User
Super User

It looks to me like your Patch() is missing the second argument, to identify the record. If you are trying to create a new record, it would read like this:

Patch('Lodd Lager Hall', 
    Defaults('Lodd Lager Hall'),
    ShowColumns(colLodd, 
        "cr17e_lodd_lager_hall_id", 
        "cr17e_item_slutt_telt", 
        "cr17e_item_sold_out"
    ) 
)

If you are trying to merge records using Patch(), then you have to present records (not tables) to the function.

 

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
v-qiaqi-msft
Community Support
Community Support

Hi @t12013,

Do you want to patch the update the main first list based on the collection?

Could you please share a bit more about the scenario?

If you want to update the table with several column values in the collection, you should use the ForAll().

Please modify your formula as below:

ForAll(colLodd,
       Patch('Lodd Lager Hall', 
            Defaults('Lodd Lager Hall'),
            {Column1_In_Your_MainList:cr17e_lodd_lager_hall_id,
             Column2_In_Your_MainList:cr17e_item_slutt_telt,
             Column3_In_Your_MainList:cr17e_item_sold_out
            }
            )
     (

Hope it could help you at some degree.

Best Regards,
Qi
t12013
Frequent Visitor

Hello evrybody , thanks for help. but i wanna Update items in the "main" list.  with the value from the second list in the collection. i have another gallery with exacly the same set up (one main list and one child list) and there it works.  The only difference is that that list doesnt include a YES/NO field. 

As mention in my post, if i remove the:

cr17e_item_sold_out

 then the funcion is happy. so its clearly something with the Yes/No field.  Any help pls  ? 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,575)