Start a new topic

Looking for Examples for Powershell AutofillMappingX

Hello,


I'm using the Powershell module to setup a document and I'm stuck on the format for the value for AutofillMappingX


I created an example in RoyalTS and looked at the connection file and got this value from the AutofilMappingX field, but putting that into the value for Powershell upsets RoyalTS.


 From example in connection file:

<AutoFillMappingX>{\{"Mode":"ReplaceValue","Name":"user","Selector":"input[name=user]","ReplacementValue":"$EffectiveUsername$","Result":0}};{\{"Mode":"ReplaceValue","Name":"password","Selector":"input[name=password]","ReplacementValue":"$EffectivePassword$","Result":0}}</AutoFillMappingX>

 

My Powershell snipet: 

$mapping='{\{"Mode":"ReplaceValue","Name":"user","Selector":"input[name=user]","ReplacementValue":"$EffectiveUsername$","Result":0}};{\{"Mode":"ReplaceValue","Name":"password","Selector":"input[name=password]","ReplacementValue":"$EffectivePassword$","Result":0}}'
$newConnection.AutoFillMappingx = $mapping

When viewing the autofill properties for the resulting connection

Exception:

Invalid property identifier character: \. Path '', line 1, position 1.


Thanks!



I think I figured it out:


   

$mapping='{"Mode":"ReplaceValue","Name":"user","Selector":"input[name=user]","ReplacementValue":"$EffectiveUsername$","Result":0}',
'{"Mode":"ReplaceValue","Name":"password","Selector":"input[name=password]","ReplacementValue":"$EffectivePassword$","Result":0}',
'{"Mode":"Click","Name":"btnOK","Selector":"#btnOK","ReplacementValue":"","Result":0}'
$newConnection.AutoFillMappingx = $mapping 

   

Hi Brian,


apologies for the situation. We currently have no "nice" API to create these mappings easier. I always suggest to create one of those in the UI and just use the resulting string in the scripts. It seems you have done the same. I hope we can provide a better API at some point but other things always get prioritized higher...


I'm sorry for the inconvenience!


Regards,
Stefan

Login or Signup to post a comment