Pull data from Datablaze, then change said data without changing the original data

Hey,

So I am making a macro that pulls information "A" from datablaze and pastes it into a web form, then at the bottom of said macro, I want to put in new numbers for "A" without changing what was inputed at the top of the macro. Whenever I do it now, It changes the top information to whatever I have inputted at the bottom.

example of the issues: Client is prescribed 30mg of medication, increase the medication to 40mg. Whenever I do this, the 30mg changes to 40mg when I paste run the macro, so it looks like the client has always been prescribed 40mg and I'm changing the medication to 40mg.

Thanks for the help :slight_smile:

Hi @bkoch, welcome to the forum. :slight_smile:

Can you please share a part of your snippet where you're experiencing this problem? Meanwhile, if I got you correctly, then I'm expecting that you may be trying to manipulate the variable itself like with {dosage=dosage+10}, but you can insert the other value directly without changing the variable itself with a formula like {=dosage+10} as in the following example:

{dbselect: SELECT Name, Dosage FROM Table1; space=id; menu=yes}
{=Dosage}
{=Dosage+10}

Ehh Sorta. Heres what I am working with:

the issues:
I want to update the Data blaze sheet for the column 'expiry OAT' for the specific 'bcare ID'. The current client's bcare ID is 1111 and their current expiry is 1/1/1. At the bottom of my macro I have a text box label as 'New OAT expiry'. If in 'new OAT expriy' I write 2/2/2, I would like the database to be updated to 2/2/2, but not change the 'expiry OAT' Date at the top of the macro. So when I submit the macro, the previous expiry date is written up top, but the datablaze sheet is updated to the new date.

S: Client due for renewal

Client ID: {formtext: name=bcare ID}{dbselect: SELECT Current iOAT med, Current iOAT dose, Expiry iOAT, Current OAT med, Current OAT Dose, Current SA med, Current SA dose, expiry OAT, Expiry SA, bcare ID, current goal, current use, recent OD, describe od FROM test WHERE bcare ID = @bcare id; space=4MR3mkngNhFrY8ws8OHNdr; menu=no}
Current iOAT: {=current ioat med} Current Dose: {=current ioat dose} Current Expiry Date: {=expiry ioat}
Current OAT: {=current oat med} Current Dose: {=current oat dose} Current Expiry Date {=expiry oat}
Current SA: {=current sa med} Current Dose: {=current sa dose} Current Expiry Date {=expiry sa}

-Due for a renewal of: {=current ioat med} {=current sa med} {=current oat med}
-Client's current Goal of care: {=current goal}
-As per nursing most recent assessment:
-Client is currently using: {=current use}
-Client's most recent overdose was: {=recent od}
-The description of the most recent overdose is: {=describe od}

O:

-Pharment: {formtoggle: name=Pharmnet check; default=no}Client is currently on: {formtext: name=Sedating meds}. No other benzo, cns depressant, z drugs or other opiates seen on pharment{endformtoggle}
{formtoggle: name=Concern RN; default=no}As per Bcare, Nursing is currently concerned about {formparagraph: name=Concerns\ ; cols=30; rows=2}{endformtoggle}

P:
Dx: OUD:Active:{formmenu: default=Severe; Moderate; Mild; Early Remission; Sustained Remission}
-Will Renew the following medications {=current ioat med} {=current sa med} {=current oat med}
-Expiry date for iOAT: {formtext: name=new expiry IOAT}
-Expiry date for OAT: {formtext: name=new expiry OAT}
-Expiry date for SA: {formtext: name=new expiry SA}

@bkoch You may add the {dbupdate} command to your snippet and it should work with no issues, I simplified the example to show how it works:

Client ID: {formtext: name=bcare ID; default=1111}{dbselect: SELECT `expiry OAT` FROM test WHERE `bcare ID` = `@bcare id`; space=id; menu=no}
{=`expiry oat`}

{formtext: name=new expiry OAT}
{dbupdate: UPDATE test SET `expiry oat`=`@new expiry oat` WHERE `bcare ID` = `@bcare id`; space=id; autoaddfields=no}

Please let me know if it works for you.

That works flawlessly! Thanks muchly!

1 Like