cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Is it possible to define an input as an optional field to an Automation Artifact?

SandipAgarwalla
Active Contributor
0 Kudos
1,902

Hi

Is it possible to define an input an optional to Automation artifact? I have currently declared few inputs to the Automation, which will be given by a Form (built using in built form editor) . e.g.

We have few more inputs to this Automation. On the User Form side, not all the fields are mandatory. Some are optional. So when the user skips the values for these optional fields, the automation fails since the fields are not added in the input context to the Automation at runtime.

e.g.

So if the fields are optional on the User Form, and the values are not entered - then these are not added in the context and then the Automation fails.

Is there a work around to define optional inputs to Automation?

Thanks

Sandip

Accepted Solutions (1)

Accepted Solutions (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

I imagine you could use a decision table, using a custom data type with all of your inputs. That data type would be the input and output of the decision. And then in the output you would set some sort of default. Inside the automation you would have to check for the defaults, depending on what you wanted to do.

SandipAgarwalla
Active Contributor
0 Kudos

Hi Daniel

Thanks for your reply. That was perfect, decision table saved us in this case.

Thanks for your help.

Regards

Sandip

Answers (4)

Answers (4)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Did you ever find a solution?

I was able to do this: 

  • Create a custom variable and set it to the input parameter you want to enable to be blank.
  • Add condition to see if it is blank.
  • If its not blank, do nothing.
  • If it's blank, add decision that automatically outputs the default value (add rule 1=1), and the for the output set the output to the custom variable.

HTH

Dan_Wroblewski_0-1720592091570.png

 

mathiasholz
Explorer
0 Kudos

Hi guys,

Is there in the meantime a "more comfortable" solution possible?

I have the the same problem. I want to make some fields as optional in the form. But when to start the automation all fields need to have a value.

If no better solution is present, could you please explain the decision table? I tried it my way (without using decision tables before) and it says that it also needs a value to start decision table (input is empty but defined in process).

Best Regards

Mathias

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

I'm not exactly sure what you are asking, but yes, a Decision activity needs to have an input. Generally, you just define something, bind something to that input, and then write a condition true = true

I imagine soon there will be something like an expression editor where you will no longer need Decisions for this purpose.

mathiasholz
Explorer
0 Kudos

Hi @Dan_Wroblewski,

I have a form with two input fields. The "Feld Nr. 2" is optional.

I want to change the value in the decision table. So when the input for that field is "empty" then the output of the decision table should be some default value like "000" or something. I can work with that value in the automation then.

mathiasholz_0-1717417863976.png

But the input for the decision table is also mandatory. So when the field in the form is not filled, it is crashing.

mathiasholz_1-1717417914288.png

 

How to solve this?

Best Regards,

Mathias

SandipAgarwalla
Active Contributor
0 Kudos

if anyone wants to replicate the issue, I have created a sample project which replicates this issue. This is hosted on the github

https://github.com/theblock-dev/SAP-SPA-Error

Download the mtar and import it in SPA lobby. Then run the process after deploying.

On the Start form, pls skip the optional fields. Do not enter any values for these. And Submit.

Thanks

Sandip

Raghu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi

Try using Condition Control to handle the optional attribute on Automation Side. Essentially use it only when it set. https://help.sap.com/docs/IRPA/8e71b41b9ea043c8bccee01a10d6ba72/7109ddfba0cb497e809b956e0b895835.htm...

SandipAgarwalla
Active Contributor
0 Kudos

Hi Raghuraman

Thanks for your reply.

Well, using Condition Control is not applicable. It is the first step of the Automation itself. The User Form will supply few fields to the Automation artifact, if some fields are missing - triggering of the first step of Automation itself is failing.

This error is easy to replicate. Create an Automation with few inputs, create a Form with same fields but optional. And try to trigger the Automation using the Form.

One solution would be - if the Automation artifact allows declaring optional inputs. But I did not find any option to do that.

Thanks

Sandip