maikvandergaag / msft-extensions

Repository for extensions mainly used for Azure DevOps Extensions
https://msftplayground.com
MIT License
126 stars 81 forks source link

How to use json with control characters in the update parameters #456

Closed smishr04 closed 1 year ago

smishr04 commented 1 year ago

Hello , I am using the - task: maikvandergaag.maikvandergaag-power-bi-actions.PowerBIActions.PowerBIActions@5 for updating datasets parameters . The database has a backslash " \" in it and while running the task gives error and says bad request .

   - task: maikvandergaag.maikvandergaag-power-bi-actions.PowerBIActions.PowerBIActions@5
     displayName: 'Power BI Action: UpdateParameters for Database'
     inputs:
       PowerBIServiceEndpoint: 'powerBI_SPN_NP'
       Action: UpdateParameters
       WorkspaceName: 'WorkspaceName'
       DatasetName: 'DatasetName'
       ParameterInput: '[{''name'' : ''ServerName'', ''newValue'' : ''"abcd.abcd.com\\qasql2020,61644"''},{''name'' : ''Database'', ''newValue'' : ''QADB7''}]'

Actual json i am looking to use - > [{"name": "ServerName","newValue": "abcd.abcd.com\qasql2020,61644"},{"name": "Database","newValue": "QADB7"}] Any help on this ? thanks in advance .

maikvandergaag commented 1 year ago

Hi @smishr04,

do you still have the problem? Double slash should work I think there is more issue with the single quotes.

maikvandergaag commented 1 year ago

Closing the issue because there was no response