The string '0000-00-00' is not a valid AllXsd value - azure

I am calling a SAP BAPI in the logic app. I have several date fields as input parameters which does not need a value to be passed. So all the date fields are being sent as blank (in postman).
When the logic app calls the SAP BAPI all the date fields are defaulted to 0000-00-00. and I get the error
The string '0000-00-00' is not a valid AllXsd value.
I also tried to change the type in schema to date , but that does not help either.
enter image description here

The error is occuring as the date had been defaulted 0000-00-00.
Receive the date as a string.
"DLV_DATE":
{
"type": "string"
}
Handle for the blank values (0000-00-00).
Rather than being defaulted 0000-00-00 - you can perform a check and if it is null, you can set it to current date and pass it subsequently in the next step

Related

Error: Incorrect parameter type for operator '<'. Expected Boolean, received Text

Here, I'm creating a new formulae field(text) based on the checkboxes. My requirement is if Attended, Canceled, Confirmed, Invited, Pending are unchecked show invited, if the confirmed checkbox is checked before the start date, The text to be populated as "confirmed". But, I'm getting error there. How can we compare those both. Any help
IF(AND(Attended__c ,Canceled__c ,Confirmed__c , Invited__c ,Pending__c),"False","Invited",
IF(OR(Confirmed__c,Confirmed__c<Start_Date_Time__c),"TRUE", "Confirmed",
IF((AND(Waiting_List__c,(!Confirmed__c)),"TRUE","Waitlisted","")))
The IF function is not set up correctly as written. The set up for the function is =IF(condition_is_met, value, value_if_not_met), so to have multiple IF's nested together, you must set it up like so: =IF(condition1_met, value, IF(condition2_met, value, value_if_condition2_not_met))
Right now you have it set up like =IF(condition1_met, value, value_if condition1_not_met, IF(condition2_met, value, value, value_if_condition2_not_met...

How to remove milliseconds from utcnow() result in Azure data factory

I want to pass a value for parameter usertime, the value should be like 2020-07-23T13:19:31Z , which will be used in my source connection url.
For this i supplied utcnow() function in the value tab. But i realized utcnow() will return the value as "2018-04-15T13:00:00.0000000Z"
To remove the millisecond part i have used the expression substring(utcnow(),1,20).
and also used expression formatDateTime('utcnow()', 'yyyy-MM-ddTHH:mm:ss').
Both my trails are useless where my expression returning error ass invalid parameter.
Could you please help me how can i supply the value 2020-07-23T13:19:31Z in Azure data factory datasource parameters.
You don't want utcNow inside quotes, here is an example from one of my pipelines using your format:
#formatDateTime(utcnow(), 'yyyy-MM-ddTHH:mm:ss')
which gives this result, setting a variable named x:
{
"name": "x",
"value": "2020-07-24T13:44:42Z"
}
Build it in 'Add dynamic content' as you can pick the functions and it will format properly if you aren't familiar.
Your substring won't work because it requires a string for the first parameter and utcnow is a timestamp.

Hapi/Joi Validation For Number Fails

I am trying to validate number value which will include integer as well as float values. Following is my implementation for the same.
Joi Schema.
const numcheckschema = Joi.object().keys({
v1:Joi.number().empty("").allow(null).default(99999),
v2:Joi.number().empty("").allow(null).default(99999),
v3:Joi.number().empty("").allow(null).default(99999)
})
Object
objnum={
v1:"15",
v2:"13.",
v3:"15"
}
objValidated = Joi.validate(objnum, numcheckschema);
console.log(objValidated);
When i execute the above mentioned code I get an error
ValidationError: child "v2" fails because ["v2" must be a number]
as per the documentation when we tries to pass any numeric value as a string it converts the values to number but here in this case my value is 13. which is not able to convert into number and throwing an error.
Is there any way by which we can convert this value to 13.0
You can use a regex in order to match numbers with a dot, for instance:
Joi.string().regex(/\d{1,2}[\,\.]{1}/)
And then combine both validations using Joi.alternatives:
Joi.alternatives().try([
Joi.number().empty("").allow(null),
Joi.string().regex(/\d{1,2}[\,\.]{1}/)
])
However, I think you may need to convert the payload to number using Number(string value). You need to check the payload type, if it isn't a Number, you need to convert it.
If you want to know more about the regex used in the example, you can test it in here: https://regexr.com/

LotusScript and CSV import and string manipulation

I am importing CSV file into Lotus notes ( Notes client application ), and have to check if incoming field is date or not.
The incoming string would look like below :
{ CriteriaDate= 5/12/2007, testing | Incoming= 5/12/2018,test| outgoing = test1,test2 }
Here it is not confirm that the first value after = would be always be the date it can be string, but I want to make sure if that is date then it should create date field into the lotus notes document.
Like from above there would be field which needs to be created as below:
CriteriaDate = 5/12/2007
CriteriaText ="testiing"
IncomingDate=5/12/2018
IncomingText ="test"
OutgoingText ="test1", "test2"
The specification observation here I want to make is that if first crietria after "=" sign is date or not using lotusscript.
please help.
Use LotusScript's IsDate() function.
For example IsDate("5/12/2007")returns true and IsDate("what is this") returns false.

Incorrect data type for operator or #function time/date expected on lotusscript?

In lotusScript: I've used:
doc.DocDate = Format(document.get("DatePublished"),"mm/dd/yyyy") 'Rem return 08/22/2017
In formula: I've used for to get year:
#Year(DocDate)
But when i run the program i get the error : "incorrect data type for operator or #function time/date expected". How to fix it?
Get date value with
document.DatePublished(0)
or
document.GetItemValue("DatePublished")(0)
Then your field DocDate should be calculated properly.
#Year() expects a NotesDateTime value. DocDate is a String value though. You can change your formula to
#Year(#ToTime(DocDate))
and it will work if your language settings are set to US date format.

Resources