Hai @iAm_ManCat ,
Sorry for posting my issue in this expired chat, as am new to powerapps am just gone through all the blogs and replying.
I got the solution for the mentioned issue but now am facing new issue as mentioned below with proper syntaxes.
Solution I found is, as I mentioned, I want to fetch the DateTime value from SQL which is in "YYYY-MM-DD" format and when I got the value it is in "MM/DD/YYYY" Format, so I used Text(MyVar,"YYYY-MM-DD") and to convert it to DATEFormat I used DateValue which is again converting to "MM/DD/YYYY" because of My browser Language Settings,so I changed the browser language settings and Modified the Syntax as below:
1. Set(SDate,LookUp('MyTable','Task ID' = ThisItem.'Task ID' && Completed = 0,Text(DateValue(Date, "en-GB"),"yyyy-mm-dd","es-ES"))); Result = 2023-01-22(as expected)
2. Set(STime,LookUp('MyTable','Task ID' = ThisItem.'Task ID' && Text(DateValue(Date, "en-GB"),"yyyy-mm-dd","es-ES") = SDate && Completed = 0,'Start Time')); Result = 2023-01-22 13:09:59(As expected)
3. Patch('MyTable',LookUp('MyTable','Task ID'= 'Task ID' && Text(DateValue(Date, "en-GB"),"yyyy-mm-dd","es-ES") = SDate && Text(DateTimeValue(Value('Start Time'),"yyyy-mm-dd HH:MM:SS")) = Text(DateTimeValue(Value(STime),"yyyy-mm-dd HH:MM:SS")) && Completed = 0),
{
'End Time':Now(),
Completed:1
}
); Result = No Lookup Data Found and am unable to Modify the SQL Data.
Note : As the Task ID, Date and Start Time are the primary Keys in SQL Table
4. Set(UpdateVar,LookUp('MyTable','Task ID'= 'Task ID' && Text(DateValue(Date, "en-GB"),"yyyy-mm-dd","es-ES") = SDate && Text(DateTimeValue(Value('Start Time'),"yyyy-mm-dd HH:MM:SS")) = Text(DateTimeValue(Value(STime),"yyyy-mm-dd HH:MM:SS")) && Completed = 0,'End Time'));
Result = 2023-01-22 15:09(As expected).
Here in Step 4 (Set function) the same Lookup logic is working fine and in Patch function Step 3, the LookUp logic is not working, any suggestion Please.