Hello all,
I have this formula in my DataTable:
If(varRole = "Contrôleur";
Search(
Filter(
T04_Weekends;
And(
And(
Society in Filter(
Usersrole;
cr5e7_email = varUser
).cr5e7_society;
varRole = "Artist"
);
'Statut' = "New" && Date >= (dpFromWeekendControleur.SelectedDate) && Date <= (dpToWeekendControleur.SelectedDate)
)
);
inpSearchBox_9.Text;
"cr5e7_name";
"cr5e7_statut";
Text("cr5e7_number")
);
However, my formula doesn't work because of "Text("cr5e7_number") which is a number in my Dataverse column.
I would like to know how can I use Search with a field of Number type, please without to create a collection if it's possible.
T04_Weekends is a table, "cr5e7_name", "cr5e7_statut" are two fields of my table.
Many greetings.
Samuel
I have no error with your formula but it doesn't work.
The value of Statut field doesn't change.
I didn't have an ID column. Thus, I created an ID column which is a number type....
Hi @Samny_98 ,
Same issue - please take a moment to understand what has happened as it will help you greatly in the future,
Patch(
T04_Weekends;
{ID: DataTable2_5.Selected.ID};
{'Statut ': DataCardValueStatutWeekend_2.Selected.Value}
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
I have in my Save Button in order to update Statut field in my DataTable.
Switch(
Text(DataCardValueStatutWeekend_2.Selected.Value);
"VALIDATED";
Patch(
T04_Weekends;
DataTable2_5.Selected;
{
'Statut ': "VALIDATED"
}
);
"ASSIGNED";
Patch(
T04_Weekends;
DataTable2_5.Selected;
{
'Statut ': "ASSIGNÉ"
}
);
"ANOMALY";
Patch(
T04_Weekends;
DataTable2_5.Selected;
{
'Statut ': "ANOMALY"
}
)
);;
If I have in my DataTable, the Search function with number fields, how do I change my formula on the Save button in order to make my Patch function with my DataTable (DataTable2_5.Selected) please ?
Hi @Samny_98 ,
That is not what I posted - you need the ID if you want the unique identifier for the record, however if Status is in the Data Table, then that should work, except it will find the first matching record only. I did notice however you have Statut in your code. All of that however is irrelevant to your Patch - you have not provided that code.
Your formula doesn't help me. I wanted just to update the values of some fields with Patch. I try to make your formula in the Item Property of my form :
LookUp(
T04_Weekends;
'Status' = DataTable2_5.Selected.'Status'
)
However, I have an error.
Sorry to disturb you and thanks for your help !
Hi @Samny_98 ,
I am saying you can no longer use DataTable2_5.Selected as it contains an additional column not in the list the form Item is based on (so the selected record contains a field the form cannot deal with).
I have noticed you are using a Data Table, not a Gallery and the code I posted will not work as there is no OnSelect property. A bit less efficient, but you could make the Item of the Form
LookUp(
SPListName,
ID = DataTable2_5.Selected.ID
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Thanks ! However, I don't understand well your explanation.
In my formula (On Select Property), of the Save Button which is out of my form , I try to add Set(MyNewDataTable;DataTable2_5.Selected) at the beginning and I changed DataTable2_5.Selected to MyNewDataTable) but I have the same error.
I just tried to change the .Selected to MyNewDataTable in the Patch...
In my app, I have just a DataTable with a DataSource T04_Weekends where I want to display the number fields,
a form with several fields and a Save Button.
I showed you previously my formula for the Save Button.
Hi @Samny_98 ,
When you use AddColumns for a Gallery or Data Table, you can no longer use .Selected as the Item of a Form selected from it as the Data Source (the list) does not contain this field. You need a different approach (which is probably better anyway) - OnSelect can be
Set(
gblID,
ThisItem.ID
)
and then the Form Item
LookUp(
SPList,
ID = gblID
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Your formula works for my DataTable but I have an issue with a bouton which updates the Status of my DataTable which has many errors.
The button's formula :
Switch(
Text(DataCardValueStatutWeekend_2.Selected.Value);
"VALIDATED";
Patch(
T04_Weekends;
DataTable2_5.Selected;
{
'Statut ': "VALIDATED"
}
);
"ASSIGNED";
Patch(
T04_Weekends;
DataTable2_5.Selected;
{
'Statut ': "ASSIGNED"
}
);
"ANOMALY";
Patch(
T04_Weekends;
DataTable2_5.Selected;
{
'Statut ': "ANOMALY"
}
)
);;
I have this error : "The Patch function has invalids arguments.
The specified column "cr5e7_no" doesn't exists . I try to add this column in my DataTable. However, I always have an error.
If I change of DataTable, it works. Thus, the issue comes from of my DataTable (for example Datable1.Selected instead of DataTable2.5.Selected) in my formula...
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2