# SweetAlertを使ったレコード更新

**URL:** <https://community.cybozu.dev/t/topic/4006>\
**Category:** kintone 開発相談\
**Created:** [2019 年 5 月 14 日午前 2:41 UTC](https://community.cybozu.dev/t/topic/4006 "2019-05-14T02:41:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Legacy\_Account958](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@Legacy\_Account958](https://community.cybozu.dev/u/Legacy_Account958)\
**Post date:** [2019 年 5 月 14 日午前 2:41 UTC](https://community.cybozu.dev/t/topic/4006/1 "2019-05-14T02:41:25Z")

</div>

プロセス実行時にSweetAlertでテキストエリアを表示させ、

その入力した値をフィールドに更新したいのですが、

SweetAlertが動かないのですがエラーをみると await Swal.fireの箇所が間違っているようです。SweetAlertからコピーしたのですがどこが間違っているのでしょうか？

jQuery.noConflict();

(function ($) {  
“use strict”;

var targetAppId = 1000;  
var recordId = event.recordId;

var ProcessEvents = [“app.record.detail.process.proceed”, “mobile.app.record.detail.process.proceed”];  
kintone.events.on(ProcessEvents, function(event) {

const {value: text} = await Swal.fire({  
input: ‘textarea’,  
inputPlaceholder: ‘Type your message here…’,  
showCancelButton: true  
})

if (text) {  
Swal.fire(text)  
}

var upsertParam = {  
“app”: targetAppId,  
“record”: {  
“id”: { recordId},  
“決裁者コメント”: { val },  
}  
}

kintone.api(“/k/v1/record”, “PUT”, upsertParam);

return event;

});

&nbsp;

})(jQuery);

&nbsp;

&nbsp;

[https://www.jsdelivr.com/package/npm/sweetalert2](https://www.jsdelivr.com/package/npm/sweetalert2)

からダウンロードして「sweetalert2.min.js」と「sweetalert2.css」は追加済みです。

&nbsp;

ご教授お願いします。

---

<div class="post-metadata">

**Author:** ![Legacy\_Account958](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@Legacy\_Account958](https://community.cybozu.dev/u/Legacy_Account958)\
**Post date:** [2019 年 5 月 14 日午前 7:05 UTC](https://community.cybozu.dev/t/topic/4006/2 "2019-05-14T07:05:25Z")

</div>

自己解決いたしました！

有難うございました
