cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vlm_mv
Advocate I
Advocate I

How do I create a collection of context variable of data cards

I would like to control the visibility of controls on screen with a variable.

For menu navigation I created a table with screens like this, and it is working:

 

UpdateContext({Tasks:
[
{title:"Restore group by search",screen:AllDeletedGroups,details:"Restore a deleted group or team by searchig for properties"},
{title:"Restore group by owner",screen:DeletedItems,details:"Restore a deleted group or team by owner"},
{title:"Update OneDrive Quota",screen:sOneDrive,details:"Read or set OneDrive Quota for a user"},
{title:"Search guest users",screen:GuestUsers,details:"Search guest users and view account details"},
{title:"View group owners",screen:Groups,details:"Search a group and view members and owners"}
]

})

 

This works fine. For DataCard visibility I tried the similar way (assuming that the screen in the formula above is some kind of type declaration):

 

UpdateContext({cards:
        [{card:Title_DataCard1} ]
        })

 

But I get an error: Name isn't valid, the identifier isn't recognized. The name is correct, I assume that the type is something else. Tried datacard too, didn't work either. Can somebody please give me a hint?

Thanks,

vm

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @vlm_mv ,

 

Do you want to use a context variable to control Cards Visible?

 

If you do, you could apply formula like below to :

UpdateContext({cVisible:!cVisible})

 

Please refer to below threads to learn more:

https://powerusers.microsoft.com/t5/Building-Power-Apps/make-fields-visible-on-a-button-click/td-p/4...

https://techcommunity.microsoft.com/t5/power-apps-power-automate/make-field-visible-depended-on-othe...

 

In addition, Screen/Form/DataCardValue controls could be used in that UpdateContext syntax but Card could not.

 

Hope this helps.

 

Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (1,600)