How to skip inserting value to Dynamics in Logic App with condition - datetime

I have many date values in CSV which is sent to logic app. In example:
date1;date2;date3;date4;date5;date6;date7
2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30
2011-12-30;;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30
It is possible that there is empty date in the CSV. I need to insert those dates to Dynamics 365. As I insert those values if I insert the empty date it goes as "", which returns an error: "Cannot convert the literal '' to the expected type 'Edm.DateTimeOffset'.". Same happens if I try to pass null when date2 is empty ("").
Is there way to skip inserting anything with logic app? Or is there some other solution to this?

Most likely, you will need to stop sending CRM empty fields.
However, you're transforming the data from the CSV shape to the D356 shape, you need to check the data and not emit the field when the source also does not exist is otherwise invalid.
It seems you're using a Foreach over the input, then creating the D365 message with a Compose Action. The thing is, the Compose Action doesn't give you much control over the output.
Instead, you should use a Liquid Transform where you can test the input before emitting any field.
Liquid - Control Flow

Related

How to get a range of columns as collection?

EDIT: For context, I am trying to import a certain range of columns in an Excel sheet into a Blue Prism object as a collection.
So I've got a worksheet with columns from A to AM. When I get sheet as collection, blank columns named "Column1" to "Column10" (the first time) and "Column1" to "Column19" (the second time, note its 19 cols this time) mysteriously appear in the collection. No data is in these columns - no whitespace, nothing.
In order to prevent anything of the sort from messing up the collection cols, I'm looking for a way to get a range of columns as a collection, e.g. A - AM. The number of rows is undetermined, so the get range as collection action is not suitable. Thanks in advance!
I never really liked the default object to get range as collection because of that. You can create a new action in the Excel VBO object (do make sure to be careful with that since re-importing the default object will basically erase the action. I usually rename it as 'MS Excel VBO Customized' or something along those lines).
The way I would do it is as follows:
Open the 'MS Excel VBO' object and duplicate the page 'Get Worksheet Rage as Collection' and name it 'Get Worksheet Range as Collection New' (or anything you deem suitable):
Edit the code stage: give it a new name (because code stages cannot have the same name in the same object) and change the inputs and code stages to match the following (I'm calling the new range as 'Address' here, but feel free to name it something else as long as you are consistent throughout):
Edit the start stage. You can delete the previous data items for Start Cell and End Cell and create one for Address:
Publish and save the object. You can then use it from the object or process you are working on and use a range such as A:AM.

Laravel Form input type="text" select data from another table on type type suggest existing data from the table and select

How can i create a form like the one on linkedin. On form input type when i type is going to fect data from a database if not existis is going to create it and fetch d and store to another table
on form input type, immediately get result: This can be done by AJAX. Laravel support Vue which can do this easily:
1a. call a function in the mounted() part.
1b. the function call itself by putting setTimeout(this.functionName,1000) at the end.
1c. in the function, check if the text in the text box is changed. if yes, make a request by axios.get('blablabla').then(response=>{//put the response into vue dataArrayName in data part});
1d. the html template is auto-updated by v-for="dataArrayName"
looks like the search is done by comparing char by char from the beginning of the string to the data.
if you press enter, pass the search string to the controller, use some logic to determine whether it is needed to create row in database

Powerapps - get stuck with UpdateContext

I am trying to build a PowerApp to log setup times of our machines by our fitters.
This is what my app looks like:
There are buttons named "Uhrzeit". Pressing these will write the current date and time into the Date/Time fields. I am using the following code:
UpdateContext({Total8:(Text( Now(); "[$-de-DE]dd/mm/yyyy hh:mm:ss" ))})
The Date/Time field is named Total8.
The code is working well but after saving the form and opening a new record the old data is still available in the fields. By clicking on the button "Zeiten zurücksetzen" I can "delete" the old data.
UpdateContext({Total8:""})
Problem: When I open one of the older records the old data is not available in the form. There is only the value of the last record. In the Common Data Service where my records are saved the values are correct.
As an example, I am saving this record:
When I open a new record, the values of the record 1 are still available. This should not be the case if my app worked properly.
For your Information:
If I enter the date/time without tapping the button, saving the record and opening a new record I don't have the problem. I think the "UpdateContext" code is not the code I should use here.
Can anyone help me solve the problem?
I don't think there's a problem with using the contexts in this way -- but remember that a context is just a variable. It isn't automatically linked to a datasource in any special way - so if you set it equal to Now(), it's going to keep that value until you do something different.
When you view an old record, you need to get the data from CDS and update your contexts to match the CDS data. Does this make sense?
Yeah thats my problem.
I want the variable to be linked to a datasource. Or is it possible to write the date/time into the fields without using a context variable?

AX 2009: Report Range on enums parsing enum value commas?

I think I may have found an interesting bug with AX 2009, and I'm unsure of how I can proceed.
I am attempting to write a new report, and one of the conditions of this report is to be filtered based on the Posting field of the LedgerTrans table. However, it seems that when the report goes to execute, the label of the enum Purchase, receipt is parsed without regard to the quotes. This normally wouldn't be a problem, but the enum label in this case contains a comma. The result is that when run the query dialog box reads: Purchase, consumption, __ILLEGAL_VALUE__. I get this result even if I use the enum value or name. The report must be left interactive, but this field must be locked, so we cannot get the users to adjust the query at run time.
At this point I don't want to change the label itself, but if it is the only way to solve this I will. Has anyone else run into this, or know how we could overcome it?
I've run into this before. Sometimes an acceptable option is hard-coding the conditional values as an OR statement, rather than the comma separated list:
((LedgerTrans.Posting == LedgerPostingType::PurchReceipt) || (LedgerTrans.Posting == LedgerPostingType::PurchConsump))
That can be typed into a range filter box, or can be set as the value of a range via x++ code:
ledgerPostingRange.value("((LedgerTrans.Posting == LedgerPostingType::PurchReceipt) ||
(LedgerTrans.Posting == LedgerPostingType::PurchConsump))");
AX doesn't try to convert these to the labels, so they stay as distinct values, instead of being rendered as labels. Note that parentheses are required for it to be parsed properly.
Since the ILLEGAL_VALUE can appear even when attempting to use a single value that contains a comma in its label, the same can be done for a single :
ledgerPostingRange.value("(LedgerTrans.Posting == LedgerPostingType::PurchReceipt)");
I would definitely change the label! But as a workaround you could use the enum value's number instead.
If the field is often queried, you could put the field in a dialog then change the query:
ledgerPostingRange.value(ledgerPostingType ? int2str(ledgerPostingType) : '');

Saving data in table in SQL Server 2005

I am asp.net developer and I work with SQL Server 2005 .
I have a table with 4 columns
say
Name
RollNo
Std
Div
if client enters
Name
RollNo
Std
but doesn't enters 4.Div column data and try's to save data, it should not give error, it should save the data in database
So it is giving you an error? Make sure that you set 4. Div column to "Allow Nulls"(No value).
It's also good to know that SQL Server can be set up to insert a default value if one isn't provided.
HI,
That means that you need to save with either default division for standard or null value.
You can setup in database to allow null and do not pass anything and that saves the data with null values.
Otherwise, I think you should put default value in Div for that standard. So whenever you dont pass that value in Insert statement, it takes default one.
Will it help or do I misunderstood it?
If I understand your problem, you're going to have NULL in one of your fields (provided you allow nulls in the fields). Depending on where you're experiencing your problem, your code would need to test for NULL from the information a client inputs or your code will need to test for NULL when it retrieves the information.
If you're running into an error, it might be prudent to post details of the error as well.

Resources