I have this code in a lbltext. Some employees can see the results on the label text and few can't see it, it turn to black box.. I contacted Microsoft and they didn't solve the issue yet.
In the If(!IsBlank code when I change the User().Email to VarUserEmail the box turn black too. So I want to see if there is something wrong with the code. I know I have a Delegation Warning. Can someone check the code?
If(
First(
Sort(
Filter(
'Back to Work Eligibility',
Employee.Email = VarUserEmail
),
'Next Check-In Date',
Descending
)
).'Next Check-In Date' < Now(),
"Self-Assessment Required",
If(!IsBlank(Last(Filter('Back to Work Eligibility', Created>Today(),'Created By'.Email = User().Email, Result).Result).Result), Last(Filter('Back to Work Eligibility', Created>Today(),'Created By'.Email = User().Email, Result).Result).Result))
Solved! Go to Solution.
Can I put instead of Red the RGBA(192,0,0,0.8)?
Yes, you are correct. They are getting only Red Box nothing on it!!!
So there is your issue...the are getting nothing in the Text of the control and your Fill formula does not account for blank, and thus returned Black.
Yes, you can set that to whatever color you want, but if you specify nothing, then black is what you get.
So, in other words, if that control is always expected to have some text in it, then the problem is with your Text property of the control, not with the fill.
And looking again at your Text property formula, you are not accounting for no result in your formula there.
In other words, you are either setting the text to "Self-Assessment Required" or what is in the Last record of the filter you have...what if there is no record returned from that? You are not setting it to anything then and it will be blank.
How if I put it like this
With(
{_usr: User()},
If(
First(
Sort(
Filter(
'Back to Work Eligibility',
Employee.Email = VarUserEmail
),
'Next Check-In Date',
Descending
)
).'Next Check-In Date' < Now(),
"Self-Assessment Required",
If(
ListBox3_1.Selected.Value = "Home",
"Work from Home",
ListBox4_1.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_1.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_2.Selected.Value = "Yes",
"Work from Home, contact HR",
ListBox5_2.Selected.Value = "No",
"Clear for Office/Field work",
Last(
Filter(
'Back to Work Eligibility',
Created > Today() && 'Created By'.Email = _usr.Email
)
).Result
)
)
)
You could, but how are you setting the selected Item of the listbox? You cannot set listbox items except by user selection.
I created a Back Result Share point List
Title Outcome
Yes Work From Home, contact HR
No Clear for Office/Field work
The in powerapps, I created List box for each question from the items from 'Back Result' and Value Title.
My problem is not sure how to add in this code the list box cause I have 4 list boxes "Yes & No".
With({_usr: User()},
If(
First(
Sort(
Filter('Back to Work Eligibility', Employee.Email = VarUserEmail),
'Next Check-In Date', Descending
)
).'Next Check-In Date' < Now(),
"Self-Assessment Required",
Last(Filter('Back to Work Eligibility', Created>Today() && 'Created By'.Email = _usr.Email)).Result
)
)
and here is the the Patch on teh Submit button
With({_user: User()},
Patch(
'Back to Work Eligibility',
Defaults('Back to Work Eligibility'),
{
Title: "Status from " & _user.FullName & " on " & Text(Today(), ShortDate),
'Check-In Date': Today(),
Result: lblResult_1.Text,
'Working Location': lblWorkingFrom_2.Text,
'Office Location': OfficeLocation.Text,
'Next Check-In Date': DateAdd(Today(), 1, Days),
Employee: {
Claims: "i:0#.f|membership|" & Lower(_user.Email),
Department: "",
DisplayName: _user.Email,
Email: _user.Email,
JobTitle: "",
Picture: ""
}
}
)
);
Navigate(scrMain, ScreenTransition.Fade);
Can you explain more about what you mean about adding the formula to a listbox?
I meant how I to add the ListBox Outcome to the lblResult_1
I did this on lblResult_1 Text Code but it didn't work. I know I am still missing on how to get the result to SharePoint when users answer their question. Unfortunately can't figure it out.
If(
First(
Sort(
Filter(
'Back to Work Eligibility',
Employee.Email = VarUserEmail
),
'Next Check-In Date',
Descending
)
).'Next Check-In Date' < Now(),
"Self-Assessment Required",
If(
ListBox3_2.Selected.Value = "Home",
"Work from Home",
ListBox1.Selected.Title = "Yes",
"Work from Home, contact Zac Elliott or Kari Rahn",
ListBox1_1.Selected.Title = "Yes",
"Work from Home, contact Zac Elliott or Kari Rahn",
ListBox1_2.Selected.Title = "Yes",
"Work from Home, contact Zac Elliott or Kari Rahn",
ListBox1_2.Selected.Title = "No",
"Clear for Office/Field work"
)
)
I guess I am just missing the concept of what you are doing. I am not sure where the listboxes come in, but in general, you cannot have anything in your app rely on the listboxes to be anything except selected by the user. You cannot set the default selected items of a listbox, so, I am assuming this formula for the label comes somewhere after that is done.
I sent you private message, can you please check if possible?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
259 | |
122 | |
85 | |
81 | |
70 |