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

How to user Filter datasource in customized component

Hi All,

 

I created a customized component, which contains several buttons and planning to use Filter() function to retrieve the data source and control the visibility of some buttons.  But the filter function has an error message "Name isn't valid. This identifier isn't recognized. Function filter has some invalid arguments". How to solve it?

 

my customized componentmy customized componentcontrol that button using filter functioncontrol that button using filter function

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @password ,

Do you want to decide the button's visible inside the component based on data source?

The reason why you met this problem is that : you could only use formulas about component inside component.

If you want to use any formulas outside component(like data source), you need to set in app, not component.

I've made a similar test for your reference:

1)inside component

create a custom input property

5134.PNG

 insert a button, set its visible to :

Component1.button1visible

//componentname.propertyname

5135.PNG

 

2)outside component, in app

insert this component

set the component's button1visible:

If(!IsEmpty(LookUp('[dbo].[testtime]',"aaa" in test1)),true,false)

5137.PNG

 

Then the button's visible will be decided by data source.

 

On your side, you should set button1visible to :
If(First(Filter('[dbo].SystemUser',Email=User().Email)).UserRole="Admin",true,false)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @password ,

Do you want to decide the button's visible inside the component based on data source?

The reason why you met this problem is that : you could only use formulas about component inside component.

If you want to use any formulas outside component(like data source), you need to set in app, not component.

I've made a similar test for your reference:

1)inside component

create a custom input property

5134.PNG

 insert a button, set its visible to :

Component1.button1visible

//componentname.propertyname

5135.PNG

 

2)outside component, in app

insert this component

set the component's button1visible:

If(!IsEmpty(LookUp('[dbo].[testtime]',"aaa" in test1)),true,false)

5137.PNG

 

Then the button's visible will be decided by data source.

 

On your side, you should set button1visible to :
If(First(Filter('[dbo].SystemUser',Email=User().Email)).UserRole="Admin",true,false)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks A lot! It works!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (66,971)